<?php uses('sanitize');?>
<div class="committees form">
<h2><?php  __('Full Search');?></h2>
<?php 
echo $this->element('searchbox',array('from'=>$this->params['controller'].'/'.$this->params['action']));
?>
<?php 
    if(!empty($multi[1])){
        echo '<br/><br/><span class="viewtitle">'.__('Decision',true).'</span><br/>';
        echo "<table cellpadding='0' cellspacing='0' border='0'>
                  <tr>
                      <th width='2%'> </th>
                      <th>".__('Desription',true)."</th>
                      <th width='80px'>".__('Deadline',true)."</th>
                  </tr>";
        for($i=1;(!empty($multi[1][$i]));$i++){
            echo '<tr>';
            echo '<td>'.$i.'</td>';
            $string = $text->highlight($text->excerpt(Sanitize::html($multi[1][$i][0]['Decision']['description'],array('remove'=>true)),$dtext[3],'50'),$dtext[2]);
            echo '<td>'.$html->link($string,$multi[1][$i][1],array('escape'=>false)).'</td>';
            echo '<td>'.date(Configure::read('date_format'),strtotime($multi[1][$i][0]['Decision']['deadline'])).'</td>';
            echo '</tr>';
        }
        echo '</table>';
    }
    if(!empty($multi[2])){
        echo '<br/><br/><span  class="viewtitle">'.__('Files',true).'</span><br/>';
        echo "<table cellpadding='0' cellspacing='0' border='0'>
                  <tr>
                      <th width='2%'> </th>
                      <th>".__('File Name',true)."</th>
                      <th width='80px'>".__('Type',true)."</th>
                  </tr>";
        for($i=1;(!empty($multi[2][$i]));$i++){
            echo '<tr>';
            echo '<td>'.$i.'</td>';
            $string = $text->highlight($text->excerpt($multi[2][$i][0]['Attachment']['filename'],$dtext[0],'50'),$dtext[1]);
            echo '<td>'.$html->link($string,$multi[2][$i][1],array('escape'=>false)).'</td>';
            echo '<td>'.$multi[2][$i][0]['Attachment']['model'].'</td>';
            echo '</tr>';
        }
        echo '</table>';
    }
    if(!empty($multi[3])){
       echo '<br/><br/><span  class="viewtitle">'.__('Meeting',true).'</span><br/>';
       echo "<table cellpadding='0' cellspacing='0' border='0'>
                  <tr>
                      <th width='2%'> </th>
                      <th>".__('Meeting Title',true)."</th>
                      <th>".__('Meeting No',true)."</th>
                      <th width='120px'>".__('Meeting Date',true)."</th>
                      <th>".__('Venue',true)."</th>
                  </tr>";
        for($i=1;(!empty($multi[3][$i]));$i++){
            echo '<tr>';
            echo '<td>'.$i.'</td>';
            if (stripos(' '.$dtext[1],',')){
                $text1=explode(',',$dtext[1]);
                $text1[1]=ltrim($text1[1]);
                $string = $text->highlight($text->excerpt($multi[3][$i][0]['Meeting']['meeting_title'],$text1[0],'50'),$text1[0]);
                echo '<td>'.$html->link($string,$multi[3][$i][1],array('escape'=>false)).'</td>';
                echo '<td>'.$text->highlight($multi[3][$i][0]['Meeting']['meeting_num'],$text1[1]).'</td>';
            }else{
                $string = $text->highlight($text->excerpt($multi[3][$i][0]['Meeting']['meeting_title'],$dtext[0],'50'),$dtext[1]);
                echo '<td>'.$html->link($string,$multi[3][$i][1],array('escape'=>false)).'</td>';
                echo '<td>'.$text->highlight($multi[3][$i][0]['Meeting']['meeting_num'],$dtext[1]).'</td>';
            }
            echo '<td>'.date(Configure::read('date_format'),strtotime($multi[3][$i][0]['Meeting']['meeting_date']));
            echo ' '.date(Configure::read('time_format'),strtotime($multi[3][$i][0]['Meeting']['meeting_date'])).'</td>';
            echo '<td>'.$multi[3][$i][0]['Meeting']['venue'].'</td>';
            echo '</tr>';
        }
        echo '</table>';
    }
    if(!empty($multi[4])){
       echo '<br/><br/><span  class="viewtitle">'.__('Project',true).'</span><br/>';
       echo "<table cellpadding='0' cellspacing='0' border='0'>
                  <tr>
                      <th width='2%'> </th>
                      <th>".__('Project Name',true)."</th>
                      <th>".__('Description',true)."</th>
                  </tr>";
        for($i=1;(!empty($multi[4][$i]));$i++){
            echo '<tr>';
            echo '<td>'.$i.'</td>';
            $string = $text->highlight($text->excerpt($multi[4][$i][0]['Item']['name'],$dtext[0],'50'),$dtext[1]);
            echo '<td>'.$html->link($string,$multi[4][$i][1],array('escape'=>false)).'</td>';
            echo '<td>'.$text->truncate($multi[4][$i][0]['Item']['description'],120).'</td>';
            echo '</tr>';
        }
        echo '</table>';
    }
    if(!empty($multi[5])){
       echo '<br/><br/><span  class="viewtitle">'.__('Groupstatus',true).'</span><br/>';
       echo "<table cellpadding='0' cellspacing='0' border='0'>
                  <tr>
                      <th width='2%'> </th>
                      <th>".__('Description',true)."</th>
                      <th width='80px'>".__('Action Date',true)."</th>
                  </tr>";
        for($i=1;(!empty($multi[5][$i]));$i++){
            echo '<tr>';
            echo '<td>'.$i.'</td>';
            $string = $text->highlight($text->excerpt($multi[5][$i][0]['Groupstatus']['description'],$dtext[0],'50'),$dtext[1]);
            echo '<td>'.$html->link($string,$multi[5][$i][1],array('escape'=>false)).'</td>';
            echo '<td>'.date(Configure::read('date_format'),strtotime($multi[5][$i][0]['Groupstatus']['action_date'])).'</td>';
            echo '</tr>';
        }
        echo '</table>';
    }
    if(!empty($multi[6])){
       echo '<br/><br/><span  class="viewtitle">'.__('Userstatus',true).'</span><br/>';
       echo "<table cellpadding='0' cellspacing='0' border='0'>
                  <tr>
                      <th width='2%'> </th>
                      <th>".__('Description',true)."</th>
                      <th width='80px'>".__('Action Date',true)."</th>
                  </tr>";
        for($i=1;(!empty($multi[6][$i][0]));$i++){
            echo '<tr>';
            echo '<td>'.$i.'</td>';
            $string = $text->highlight($text->excerpt($multi[6][$i][0]['Userstatus']['description'],$dtext[0],'50'),$dtext[1]);
            echo '<td>'.$html->link($string,$multi[6][$i][1],array('escape'=>false)).'</td>';
            echo '<td>'.date(Configure::read('date_format'),strtotime($multi[6][$i][0]['Userstatus']['action_date'])).'</td>';
            echo '</tr>';
        }
        echo '</table>';
    }
 ?>
</div>
